package com.wuye.letter.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wuye.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuye.letter.mapper.WyLetterMapper;
import com.wuye.letter.domain.WyLetter;
import com.wuye.letter.service.IWyLetterService;

/**
 * 短信记录Service业务层处理
 * 
 * @author avalon
 * @date 2024-11-27
 */
@Service
public class WyLetterServiceImpl extends ServiceImpl<WyLetterMapper, WyLetter> implements IWyLetterService
{
    @Autowired
    private WyLetterMapper wyLetterMapper;

    /**
     * 查询短信记录
     * 
     * @param letterId 短信记录主键
     * @return 短信记录
     */
    @Override
    public WyLetter selectWyLetterByLetterId(Long letterId)
    {
        return wyLetterMapper.selectWyLetterByLetterId(letterId);
    }

    /**
     * 查询短信记录列表
     * 
     * @param wyLetter 短信记录
     * @return 短信记录
     */
    @Override
    public List<WyLetter> selectWyLetterList(WyLetter wyLetter)
    {
        return wyLetterMapper.selectWyLetterList(wyLetter);
    }

    /**
     * 新增短信记录
     * 
     * @param wyLetter 短信记录
     * @return 结果
     */
    @Override
    public int insertWyLetter(WyLetter wyLetter)
    {
        wyLetter.setCreateTime(DateUtils.getNowDate());
        return wyLetterMapper.insertWyLetter(wyLetter);
    }

    /**
     * 修改短信记录
     * 
     * @param wyLetter 短信记录
     * @return 结果
     */
    @Override
    public int updateWyLetter(WyLetter wyLetter)
    {
        return wyLetterMapper.updateWyLetter(wyLetter);
    }

    /**
     * 批量删除短信记录
     * 
     * @param letterIds 需要删除的短信记录主键
     * @return 结果
     */
    @Override
    public int deleteWyLetterByLetterIds(Long[] letterIds)
    {
        return wyLetterMapper.deleteWyLetterByLetterIds(letterIds);
    }

    /**
     * 删除短信记录信息
     * 
     * @param letterId 短信记录主键
     * @return 结果
     */
    @Override
    public int deleteWyLetterByLetterId(Long letterId)
    {
        return wyLetterMapper.deleteWyLetterByLetterId(letterId);
    }
}
